package reasoner.app;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;



import java.util.*;

import datatableaux.Reason;


public class Start {
	/**
	 * @param args
	 */
	public static final Properties CONF = new Properties();
	
    static{
    	FileInputStream fs = null;
        try {
        	 fs = new FileInputStream("Conf.properties");
        	CONF.load(fs);
        	fs.close();
        } catch (IOException e) {
            e.printStackTrace();
        } finally{
        	try {
				fs.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
        }
    }
    public static boolean debug = CONF.getProperty("debug").equalsIgnoreCase("true");
	
    

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		//String tboxfile = "tbox";
		//String aboxfile = "abox";
		
//		String tboxfile = "dpreview.tbox";
//		String aboxfile = "dpreview.abox";
		//String satfile = "sat";
//		if( args.length > 1 ) {
//			tboxfile = args[0];
//			//satfile = args[1];
//		}
//		Concept c1 = new ExistsConcept(new Role("R"), new PConcept("C"));
//		ExistsConcept c2 = new ExistsConcept(new Role("R"), new PConcept("C"));
//		HashSet<Concept> myc = new HashSet<Concept>();
//		myc.add(c1);
//		if(myc.contains(c2))
//		System.out.println(c1.hashCode() +" "+c2.hashCode() );
		Reason res = new Reason();
		//ABox ab = res.getABox(aboxfile, false);
		//TBox tb = KBAccess.getTBox(tboxfile, false);
		//res.ABoxConsistentWRTTBox(true, tb, ab, res.getQueryAssertions());
		//TBox tb = res.getTBox(tboxfile, true);
		//Concept c = res.getSubsumptionTest(satfile);
		//Concept c1 = new PConcept ("C");
		//res.subsumes(c, tb);
		//res.subsumes(c1, tb);
		//res.subsumes(c, tb);
		//Concept c = new PConcept("C");
		//Concept c1 = new ExistsConcept(new Role("R"), new PConcept("D"));
		//Concept c2 = new ExistsConcept(new Role("R"), new PConcept("D"));		
	}

	
	
	public static String readFileAsString(String filePath) throws IOException{
        StringBuffer fileData = new StringBuffer(1000);
        FileReader fr = null;
        BufferedReader reader = null;
		try {
			fr = new FileReader(filePath);
			reader = new BufferedReader(fr);
	        char[] buf = new char[1024];
	        int numRead=0;
	        while((numRead=reader.read(buf)) != -1){
	            fileData.append(buf, 0, numRead);
	        }
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{      
			fr.close();
			reader.close();
		}
        return fileData.toString();
    }

}
